<style xmlns="http://www.w3.org/1999/html">
    .info-wrap>td {
        text-align: left;
        padding-top: 10px;
    }
    .info-wrap>td>div {
        max-height: 200px;
        overflow-y: auto;
    }
    .tiao-val {
        width: 30px;
        height: 30px;
        margin: 5px 5px 0 0;
        outline: none;
        font-size: 14px;
    }
    .tiao-btn {
        font-size: 14px;
    }
    .link-update{
        text-decoration: none;
        background: #337ab7;
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        margin-bottom: 10px;
        display: inline-block;
    }
    .link-update:hover{
        text-decoration: none;
        color: white;
        background: #286090;
    }
    .link-del{
        text-decoration: none;
        background: red;
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        margin-bottom: 10px;
        display: inline-block;
    }
    .link-del:hover{
        text-decoration: none;
        background: red;
        color: white;
    }
    .pagination li a{
        color:#286090!important;
    }
    .pagination li.active a{
        background: #286090!important;
        color: white!important;
        border: 1px solid #286090!important;
    }
    .tiao-val{
        width: 42px;
        height: 24px;
        text-align: center;
        line-height: 24px;
        margin: 0 10px 0 0!important;
    }
    .tiao-btn{
        background: #286090!important;
        color: white!important;
        border: 1px solid #286090!important;
        border-radius: 3px;
    }
    .addBtn{
        text-decoration: none;
        background: #337ab7;
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        margin-bottom:10px;
        display: inline-block;
    }
    .nav-tabs>li{
        margin-bottom: -3px!important;
    }
    .nav-tabs.nav-stacked>li>a{
        color: #0088cc;
        text-decoration: none;
    }
    .tiao-wrap{
        display: flex;
        align-items: center;
    }
    .info-wrap{
        border-bottom: 1px solid #cccccc;
    }


</style>
<link rel="stylesheet" href="https://file.viplgw.cn/ui/sat/cn/css/bootstrap.min.css">
<script src="https://file.viplgw.cn/ui/sat/cn/js/bootstrap.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/My97DatePicker/WdatePicker.js"></script>
<div class="span10">
    <div style="margin-bottom: 20px">
        <a href="/index/index">首页</a><span >&gt;</span><span>案列管理</span>
    </div>

    <a class="addBtn"  href="<?php echo baseUrl.'/content/case/add'?>">添加案例</a>

<!--    <form action="--><?php //echo baseUrl ?><!--/content/case/index" method="get" class="form-horizontal" style="margin-bottom: 10px;">-->
<!--        <table class="table">-->
<!--            <tr>-->
<!--                <td>-->
<!--                    关键词：-->
<!--                </td>-->
<!--                <td>-->
<!--                    <input name="name" class="input-small" size="25" type="text" class="number"-->
<!--                           value="--><?php //echo isset($_GET['name']) ? $_GET['name'] : '' ?><!--"/>-->
<!--                </td>-->
<!---->
<!--            </tr>-->
<!--            <tr>-->
<!--                <td>-->
<!--                    创建时间：-->
<!--                </td>-->
<!--                <td>-->
<!--                    <input class="input-small Wdate" onclick="WdatePicker()" type="text" size="10" name="beginTime"-->
<!--                           value="--><?php //echo isset($_GET['beginTime']) ? $_GET['beginTime'] : '' ?><!--"/> - <input-->
<!--                        class="input-small Wdate" onclick="WdatePicker()" size="10" type="text" name="endTime"-->
<!--                        value="--><?php //echo isset($_GET['endTime']) ? $_GET['endTime'] : '' ?><!--"/>-->
<!--                </td>-->
<!--                <td>-->
<!--                    <button class="btn btn-primary" type="submit">提交</button>-->
<!--                </td>-->
<!--            </tr>-->
<!--        </table>-->
<!--    </form>-->


    <form action="/content/api/sort" method="post">
        <table border="0" style="table-layout: fixed;width:100%;" id="infoTable">
            <tr align="center">
                <th width="60px">排序</th>
                <th width="60px">id</th>
                <th>标题</th>
                <th>图片</th>
                <th>摘要</th>
                <th>学前成绩(听说读写总分)</th>
                <th>学后成绩(听说读写总分)</th>
                <th>所报班级</th>
                <th width="120px">出分时间</th>
                <th width="120px">发布时间</th>
                <th width="60px">点击量</th>
                <th width="120px">操作</th>
            </tr>
            <?php foreach ($data as $v) { ?>
                <tr class="info-wrap">
                    <td>
                        <div>
                            <input style="width: 25px;text-align: center;margin-bottom: 0;" name="sort[]" type="text" value="<?php echo $v['sort'] ?>">
                            <input name="id[]" type="hidden" value="<?php echo $v['id'] ?>">
                        </div>
                    </td>
                    <td>
                        <div>
                            <?php echo $v['id'] ?>
                        </div>
                    </td>
                    <td>
                        <div>
                            <?php echo $v['name'] ?>
                        </div>
                    </td>
                    <td title="<?php echo $v['pic'] ?>">
                        <div>
                            <?php echo $v['pic'] ?>
                        </div>
                    </td>

                    <td>
                        <div>
                            <?php echo $v['summary'] ?>
                        </div>
                    </td>
                    <td>
                        <div>
                            <?php echo str_replace(',','-',$v['preScore']) ?>
                        </div>
                    </td>
                    <td>
                        <div>
                            <?php echo str_replace(',','-',$v['afterScore']) ?>
                        </div>
                    </td>
                    <td>
                        <div>
                            <?php echo $v['class'] ?>
                        </div>
                    </td>
                    <td>
                        <div>
                            <?php echo $v['outTime'] ?>
                        </div>
                    </td>
                    <td>
                        <div>
                            <?php echo date('Y-m-d H:i:s',$v['createTime']) ?>
                        </div>
                    </td>
                    <td>
                        <div>
                            <?php echo $v['viewCount'] ?>
                        </div>
                    </td>

                    <td>
                        <div>
                            <a class="link-update"
                               href="<?php echo baseUrl . '/content/case/add' . '?' . 'id=' . $v['id'] ?>">修改</a>
                            <a class="link-del" href="javascript:void(0)" onclick="del(<?php echo $v['id'] ?>)">删除</a>
                        </div>
                    </td>
                </tr>
            <?php } ?>
        </table>
        <input type="hidden" name="cate" value="3">
        <button class="push btn btn-primary" type="submit" style="margin-top: 15px;">排序</button>
    </form>
    <div class="tiao-wrap">
        <?php echo $str?>
        <div style="margin-left: 30px;">
            <input type="text" class="tiao-val"><button class="tiao-btn">跳转</button>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tiao-btn').click(function () {
            location.href = location.pathname+"?page="+$('.tiao-val').val();
        })
    })
    function del(id){
        if(confirm("确定删除内容吗")) {
           $.get('/content/case/del',{
                id: id
            },function (msg) {
               if (msg) {
                   alert('删除成功');
                   window.location.reload();
               }
            },'json')
        }
    }
</script>
